package com.ruoyi.system.domain.Vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.system.utils.validate.AddGroup;
import com.ruoyi.system.utils.validate.EditGroup;
import com.ruoyi.system.utils.validate.LoginGroup;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Null;
import javax.validation.constraints.Pattern;

/**
 * @Description: 注册用户模块业务
 * @Author: jsj
 * @Date: 2022/8/18
 */
@Data
@ToString
public class UsersVo {
    /**
     * 用户手机，用作用户账户使用
     */
    @NotBlank(message = "用户手机不能为空", groups = { AddGroup.class, EditGroup.class , LoginGroup.class})
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$",message = "手机号格式不正确")
    private String userPhone;

    /**
     * 用户密码
     */
    @NotBlank(message = "用户密码不能为空", groups = { AddGroup.class, EditGroup.class,LoginGroup.class })
    @Length(min = 6,max = 18,message = "密码必须是6-18位")
    private String userPass;

    /**
     * 新密码
     */
    // @Null(message = "用户密码不能为空", groups = { AddGroup.class,LoginGroup.class })
    // @NotBlank(message = "用户密码不能为空", groups = { EditGroup.class })
    // @Length(min = 6,max = 18,message = "密码必须是6-18位")
    // private String newPass;

    /**
     * 手机验证码字段，表中不存在该字段
     */
    @NotBlank(message = "手机验证码不能为空",groups = {EditGroup.class})
    private String phoneCaptcha;

    /**
     * 图形验证码字段，表中不存在该字段
     */
    // @NotBlank(message = "验证码不能为空",groups = {EditGroup.class})
    // private String picCaptcha;
}
